#include "SZNR/SZNRReadBillTemplateFile.h"

SZNRReadBillTemplateFile::SZNRReadBillTemplateFile()
{

}

void SZNRReadBillTemplateFile::setTempleteFieDir(const QString & billTemplateDir)
{
    m_fileDir= QDir(billTemplateDir);
}

QFileInfoList SZNRReadBillTemplateFile::getBillTempLateList()
{
    QStringList string;
    string << "*";
    QFileInfoList fileList =  m_fileDir.entryInfoList();
    qDebug() <<"获取到的文件列表 = " << fileList;
    return fileList;
}

void SZNRReadBillTemplateFile::selectOneTemplate(const QFileInfo & fileInfo)
{
    qDebug() << "文件名字 = " << fileInfo.fileName();
    QFile file;
    file.setFileName(fileInfo.fileName());
    if (file.open(QIODevice::ReadOnly)) {
        m_fileContent = file.readAll();
        qDebug() << m_fileContent;
    }
    else {
        qDebug() << "打开失败";
    }
}
